package com.steven.im.utils;

import com.steven.im.App;
import com.steven.im.base.Constant;

/**
 * Created by Steven on 2019/1/24.
 */
public class UserUtils {
    //判断用户是否登录

    public static boolean checkLogin() {
        //发生变化  进行调试
        String accessToken = SPUtils.get(App.getContext(), Constant.CommonInfo.ACCESS_TOKEN, "") + "";
        return !"".equals(accessToken);
    }

    //清空用户信息  401的时候
    public static void clearUserInfo() {
        SPUtils.remove(App.getContext(), Constant.CommonInfo.ACCESS_TOKEN);
        SPUtils.remove(App.getContext(), Constant.CommonInfo.TOKEN);
    }
}
